Due: Tuesday, May 19th by 6:00 PM
Complete the problems on the following pages.
You are required to submit your own solutions. You are allowed to discuss the homework with other students. However, you must complete the problems in Grin on your own. Moreover, you must be able to explain your solution at any time. We reserve ourselves the right to ask you to explain your work at any time in the course of this class.
You have a total of three late days during the quarter, but you can only use one late day on any one homework, giving an additional day on both parts. Please plan ahead.
Submit your solution at http://grin.cs.washington.edu
Each part of each task is listed as its own problem.
You have unlimited attempts on each part.
All completed parts get full credit and uncompleted parts get no credit.
For each of the following, construct a regular expression that matches exactly the given set of strings.
Binary strings that end with 00.
Binary strings with an odd number of 1s.
Hint: Think about what an arbitrary string in this language
looks like around each of its 1s. Any number of
0s can appear before, between, and after the
1s.
Binary strings that do not contain 00 as a
substring.
Hint: After every 0, what is allowed to come
next?
For each of the following, construct a context-free grammar that generates exactly the given set of strings. The start symbol of your grammar should be .
Binary strings matching the regular expression “”.
All strings of the form , where .
All strings of the form where .
For each of the following, construct a DFA that recognizes exactly the given language. For all states in your DFA, write “documentation” for them by describing, in English, the set of strings that end in that state. (No need to turn in the state documentation for this homework, but don’t skip it — you can and will be asked to write it on a quiz/exam with FSM problems.)
Binary strings with an odd number of 0s.
Binary strings that start with 1 and end with
0.
Binary strings that contain 110 as a
substring.